mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 17:18:06 +11:00
8086asm: begin adding MODRM-enabled ops
This commit is contained in:
parent
749fdf1b18
commit
210b833c71
7
blk/731
7
blk/731
@ -3,7 +3,12 @@ JMP8, L1 FWR8 ( start )
|
|||||||
L2 BSET ( msg )
|
L2 BSET ( msg )
|
||||||
," Hello, World!" 0 A,
|
," Hello, World!" 0 A,
|
||||||
L1 FSET ( start )
|
L1 FSET ( start )
|
||||||
AH 0x42 MOVri,
|
CLI,
|
||||||
|
AH 0 MOVri,
|
||||||
|
AL 2 MOVri,
|
||||||
0x10 INT,
|
0x10 INT,
|
||||||
SI L2 @ ( msg ) MOVrI,
|
SI L2 @ ( msg ) MOVrI,
|
||||||
|
AH 0x0e MOVri,
|
||||||
|
LODSB,
|
||||||
|
AL AL ORrr,
|
||||||
PC ORG @ DUMP
|
PC ORG @ DUMP
|
||||||
|
6
blk/752
6
blk/752
@ -1,2 +1,8 @@
|
|||||||
|
( Splits word into msb/lsb, lsb being on TOS )
|
||||||
|
: SPLITB
|
||||||
|
256 /MOD SWAP
|
||||||
|
;
|
||||||
: PC H@ ORG @ - ;
|
: PC H@ ORG @ - ;
|
||||||
: A, C, ;
|
: A, C, ;
|
||||||
|
( dst8 src8 -- modrm )
|
||||||
|
: MODRMrr 0x7 AND 3 LSHIFT SWAP 0x7 AND OR 0xc0 OR ;
|
||||||
|
5
blk/753
5
blk/753
@ -1,6 +1,9 @@
|
|||||||
: MOVri, SWAP 0xb0 OR A, A, ;
|
: MOVri, SWAP 0xb0 OR A, A, ;
|
||||||
: MOVrI, SWAP 0xb0 OR A, 256 /MOD A, A, ;
|
: MOVrI, SWAP 0xb0 OR A, SPLITB A, A, ;
|
||||||
: INT, 0xcd A, A, ;
|
: INT, 0xcd A, A, ;
|
||||||
( no argument, flow ops are special )
|
( no argument, flow ops are special )
|
||||||
: JMP8, 0xeb A, ;
|
: JMP8, 0xeb A, ;
|
||||||
: JMP16, 0xe9 A, ;
|
: JMP16, 0xe9 A, ;
|
||||||
|
: LODSB, 0xac A, ;
|
||||||
|
: CLI, 0xfa A, ;
|
||||||
|
: ORrr, 0x08 A, MODRMrr A, ;
|
||||||
|
3
blk/754
3
blk/754
@ -10,8 +10,7 @@
|
|||||||
: IFNC, JRC, FJR, ; )
|
: IFNC, JRC, FJR, ; )
|
||||||
: THEN,
|
: THEN,
|
||||||
DUP PC ( l l pc )
|
DUP PC ( l l pc )
|
||||||
-^ ( l off )
|
-^ 1- ( l off )
|
||||||
( warning: l is a PC offset, not a mem addr! )
|
( warning: l is a PC offset, not a mem addr! )
|
||||||
SWAP ORG @ + ( BIN( @ - ) ( off addr )
|
SWAP ORG @ + ( BIN( @ - ) ( off addr )
|
||||||
C! ;
|
C! ;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user