Changeset 122 for trunk/include/asm.inc


Ignore:
Timestamp:
Apr 8, 2017, 12:27:21 AM (8 years ago)
Author:
Ben Rietbroek
Message:

Added some macros for use when debugging [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/asm.inc

    r70 r122  
    3030EndM
    3131
     32; Macro to show some text when using debugging.
     33; Possibly a register dump is done after this code, so we save and restore
     34; the flags too.
     35DBG_TEXT_OUT_AUX   MACRO   txt
     36        local   skip00              ; macro local jump labels
     37        local   txt00               ; macro local storage definitions
     38        jmp     skip00              ; jump over the string
     39txt00   db      10,txt,10,0         ; macro text-string parameter inserted here
     40    skip00:
     41        pushf                       ; save flags
     42        push    si                  ; used to print the string
     43        mov     si, offset [txt00]  ; address of the string
     44        call    AuxIO_Print         ; output to serial port
     45        pop     si                  ; restore previous value
     46        popf                        ; restore flags
     47ENDM
     48
     49; Push CPU working context
     50PUSHRF  MACRO
     51        pusha
     52        pushf
     53ENDM
     54
     55; Restore CPU working context
     56POPRF   MACRO
     57        popf
     58        popa
     59ENDM
     60
     61; Push CPU working context including DS and ES
     62PUSHRSF MACRO
     63        pusha
     64        push    ds
     65        push    es
     66        pushf
     67ENDM
     68
     69; Restore CPU working context including DS and ES
     70POPRSF  MACRO
     71        popf
     72        pop     es
     73        pop     ds
     74        popa
     75ENDM
    3276
    3377; Rousseau:
Note: See TracChangeset for help on using the changeset viewer.