Skip to content

Commit 2f161c2

Browse files
committed
update
1 parent ec00a7c commit 2f161c2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/_internal/shared/code16.asm

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,31 @@ code16_start:
117117
118118
DOS_Exit 0
119119

120+
; -----------------------------------------------------------------
121+
; BX = Basis of Array
122+
mov bx, command_args
123+
124+
; size in powers of 2 (4,8,16) -> shift
125+
; e.g.: COMMAND_LINE_size = 65 -> *6 = << 6
126+
;
127+
; << 2 => 4
128+
; << 3 => 8
129+
; << 4 => 16
130+
; << 5 => 32
131+
; << 6 => 64 ( 65 struc size minus 1 (v. Neumann))
132+
;
133+
; +---- source index
134+
; | +------ index 0 based
135+
; | | +-- struc size
136+
; | | |
137+
; V V V
138+
; SI = CX * 65 => (CX << 6) + CX ; CX = 0,1,2,3,4...
139+
mov si, cx
140+
shl si, 6
141+
add si, cx
142+
mov byte [bx + si + COMMAND_LINE.arg_str], 'A'
143+
144+
; -----------------------------------------------------------------
120145
jmp .token_done
121146
122147

0 commit comments

Comments
 (0)