Skip to content

Commit

Permalink
fix stack-variable accesses
Browse files Browse the repository at this point in the history
  • Loading branch information
peterferrie committed Apr 12, 2024
1 parent 9e093b4 commit abb8dce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions ray.asm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ com_file: equ 0

int 0x10 ; Call BIOS.

enter total-2,0 ; Make space for internal variables,
enter total,0 ; Make space for internal variables,
; and use BP to refer them.

push 0xa000 ; Point to video RAM.
Expand Down Expand Up @@ -296,24 +296,24 @@ const_1_4: dd 1.4
;
; Variables are kept on the stack to make instructions shorter.
;
var_n: equ base+$02 ; Integer
var_m: equ base+$04 ; Integer
pixel: equ base+$06 ; Integer
var_u: equ base+$08 ; u - Ray direction (normalized)
var_v: equ base+$0c ; v - Ray direction (normalized)
var_w: equ base+$10 ; w - Ray direction (normalized)
var_x: equ base+$14 ; x - Origin of ray
var_y: equ base+$18 ; y - Origin of ray
var_z: equ base+$1c ; z - Origin of ray
var_e: equ base+$20 ; e - Position of sphere
var_f: equ base+$24 ; f - Position of sphere
var_g: equ base+$28 ; g - Position of sphere
var_p: equ base+$2c ; Float
var_d: equ base+$30 ; Float
var_t: equ base+$34 ; Float
var_i: equ base+$38 ; Float
var_a: equ base+$3c ; Float
var_s: equ base+$40 ; Float
var_n: equ -$42 ; Integer
var_m: equ -$40 ; Integer
pixel: equ -$3e ; Integer
var_u: equ -$3c ; u - Ray direction (normalized)
var_v: equ -$38 ; v - Ray direction (normalized)
var_w: equ -$34 ; w - Ray direction (normalized)
var_x: equ -$30 ; x - Origin of ray
var_y: equ -$1c ; y - Origin of ray
var_z: equ -$28 ; z - Origin of ray
var_e: equ -$24 ; e - Position of sphere
var_f: equ -$20 ; f - Position of sphere
var_g: equ -$1c ; g - Position of sphere
var_p: equ -$18 ; Float
var_d: equ -$14 ; Float
var_t: equ -$10 ; Float
var_i: equ -$0c ; Float
var_a: equ -$08 ; Float
var_s: equ -$04 ; Float

total: equ base+$44

Binary file modified ray.com
Binary file not shown.

0 comments on commit abb8dce

Please sign in to comment.