mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 16:48:05 +11:00
6bc1738bfd
8086 asm is a lot terser than z80... Those indirect memory operations are very handy.
17 lines
684 B
Plaintext
17 lines
684 B
Plaintext
: OPrr CREATE C, DOES> C@ A, 3 LSHIFT OR 0xc0 OR A, ;
|
|
0x31 OPrr XORxx, 0x30 OPrr XORrr,
|
|
0x88 OPrr MOVrr, 0x89 OPrr MOVxx, 0x28 OPrr SUBrr,
|
|
0x29 OPrr SUBxx, 0x08 OPrr ORrr, 0x09 OPrr ORxx,
|
|
0x3a OPrr CMPrr, 0x3b OPrr CMPxx, 0x00 OPrr ADDrr,
|
|
0x01 OPrr ADDxx,
|
|
|
|
: OPm ( modrm op ) CREATE C, C, DOES> C@+ A, C@ OR A, ;
|
|
0 0xff OPm INC[w], 0 0xfe OPm INC[b],
|
|
0x8 0xff OPm DEC[w], 0x8 0xfe OPm DEC[b],
|
|
0x30 0xff OPm PUSH[w], 0 0x8f OPm POP[w],
|
|
: OPm+ ( modrm op ) CREATE C, C, DOES>
|
|
( m off ) C@+ A, C@ ROT OR A, A, ;
|
|
0x40 0xff OPm+ INC[w]+, 0x40 0xfe OPm+ INC[b]+,
|
|
0x48 0xff OPm+ DEC[w]+, 0x48 0xfe OPm+ DEC[b]+,
|
|
0x70 0xff OPm+ PUSH[w]+, 0x40 0x8f OPm+ POP[w]+,
|