dialer/target.jrt

38 lines
808 B
Plaintext
Executable File

defer target
defer target!
defer @t
defer b@t
defer !t
defer b!t
: asm-here
' here ' target redefine
' here! ' target! redefine
' @ ' @t redefine
' b@ ' b@t redefine
' ! ' !t redefine
' b! ' b!t redefine ;
segalloc const comseg
var comaddr
0x100 comaddr !
: asm-com
:| comaddr @ |; ' target redefine
:| comaddr ! |; ' target! redefine
:| comseg @far |; ' @t redefine
:| comseg b@far |; ' b@t redefine
:| comseg !far |; ' !t redefine
:| comseg b!far |; ' b!t redefine ;
: +target! ( bytes -- prevtarget ) target dup >rot + target! ;
: >t 1 +target! b!t ;
: w>t 2 +target! !t ;
asm-com
: ALLOT ( n -- ) begin dup while 1- 0 >t repeat drop ;
: patchpt ( -- tptr ) target 0 w>t ;
: patch!t ( tptr -- ) target swap !t ;