z80:Macros

From Learn @ Cemetech
Jump to navigationJump to search

Macros are lines of code that on compile are replaced with other lines of code. This is extremely useful as most macros compress lines of code into one instruction.

TI-83 Plus Macros

Equivalent Codes

   #define	bcall(xxxx)		rst 28h	\ .dw xxxx
   #define	bjump(xxxx)		call 50h	\ .dw xxxx
   #define	bcallz(xxxx)	jr nz,$+5	\ rst 28h	\ .dw xxxx
   #define	bcallnz(xxxx)	jr z,$+5	\ rst 28h	\ .dw xxxx
   #define	bcallc(xxxx)	jr nc,$+5	\ rst 28h	\ .dw xxxx
   #define	bcallnc(xxxx)	jr c,$+5	\ rst 28h	\ .dw xxxx
   #define	equ .equ
   #define	EQU .equ
   #define	errhandon(label)	ld hl,label	\ call 59h
   #define	errhandoff()	call 5Ch