source: xtideuniversalbios/trunk/Assembly_Library/Inc/Macros.inc@ 108

Last change on this file since 108 was 104, checked in by Tomi Tilli, 14 years ago

Changes to Assembly Library:

  • Some more optimizations.
  • Moved macros.inc from XTIDE Universal BIOS to Assembly Library.
File size: 1.3 KB
Line 
1; Project name : Assembly Library
2; Description : This is the place to put various generic macros.
3; Should be included immediately after emulate.inc
4
5;--------------------------------------------------------------------
6; Skips the immediately following 2 byte instruction by using it
7; as an immediate value to a dummy instruction.
8; Destroys the contents of %1.
9;
10; SKIP2B
11; Parameters:
12; %1: Any 16 bit general purpose register or F for flags.
13; Returns:
14; Nothing
15; Corrupts registers:
16; %1
17;--------------------------------------------------------------------
18%macro SKIP2B 1
19 %ifidni %1, f
20 db 03Dh ; Opcode byte for CMP AX, <immed>
21 ;db 0A9h ; Alt. version TEST AX, <immed>
22 %elifidni %1, ax
23 db 0B8h ; Opcode byte for MOV AX, <immed>
24 %elifidni %1, cx
25 db 0B9h ; Opcode byte for MOV CX, <immed>
26 %elifidni %1, dx
27 db 0BAh ; Opcode byte for MOV DX, <immed>
28 %elifidni %1, bx
29 db 0BBh ; Opcode byte for MOV BX, <immed>
30 %elifidni %1, sp
31 db 0BCh ; Opcode byte for MOV SP, <immed>
32 %elifidni %1, bp
33 db 0BDh ; Opcode byte for MOV BP, <immed>
34 %elifidni %1, si
35 db 0BEh ; Opcode byte for MOV SI, <immed>
36 %elifidni %1, di
37 db 0BFh ; Opcode byte for MOV DI, <immed>
38 %else
39 %error "Invalid parameter passed to SKIP2B"
40 %endif
41%endmacro
Note: See TracBrowser for help on using the repository browser.