about summary refs log tree commit diff stats
path: root/html
ModeNameSize
-rw-r--r--000organization.cc.html21901log stats plain blame
-rw-r--r--001help.cc.html43944log stats plain blame
-rw-r--r--002test.cc.html21277log stats plain blame
-rw-r--r--003trace.cc.html88649log stats plain blame
-rw-r--r--003trace.test.cc.html29959log stats plain blame
-rw-r--r--010---vm.cc.html73823log stats plain blame
-rw-r--r--011run.cc.html71099log stats plain blame
-rw-r--r--012elf.cc.html45447log stats plain blame
-rw-r--r--013direct_addressing.cc.html221989log stats plain blame
-rw-r--r--014indirect_addressing.cc.html157013log stats plain blame
-rw-r--r--015immediate_addressing.cc.html207244log stats plain blame
-rw-r--r--016index_addressing.cc.html26061log stats plain blame
-rw-r--r--017jump_disp8.cc.html61718log stats plain blame
-rw-r--r--018jump_disp32.cc.html59981log stats plain blame
-rw-r--r--019functions.cc.html20729log stats plain blame
-rw-r--r--020syscalls.cc.html40503log stats plain blame
-rw-r--r--021byte_addressing.cc.html57281log stats plain blame
-rw-r--r--022div.cc.html7689log stats plain blame
-rw-r--r--030---translate.cc.html38174log stats plain blame
-rw-r--r--031transforms.cc.html3731log stats plain blame
-rw-r--r--032---operands.cc.html98481log stats plain blame
-rw-r--r--033check_operands.cc.html143759log stats plain blame
-rw-r--r--034check_operand_bounds.cc.html26925log stats plain blame
-rw-r--r--035compute_segment_address.cc.html15769log stats plain blame
-rw-r--r--036labels.cc.html68371log stats plain blame
-rw-r--r--037global_variables.cc.html57115log stats plain blame
-rw-r--r--038---literal_strings.cc.html60106log stats plain blame
-rw-r--r--039debug.cc.html29729log stats plain blame
-rw-r--r--040---tests.cc.html18655log stats plain blame
-rw-r--r--050_write.subx.html8940log stats plain blame
-rw-r--r--051test.subx.html14797log stats plain blame
-rw-r--r--052kernel-string-equal.subx.html36525log stats plain blame
-rw-r--r--053new-segment.subx.html14139log stats plain blame
-rw-r--r--054string-equal.subx.html38960log stats plain blame
-rw-r--r--055stream.subx.html12794log stats plain blame
-rw-r--r--056trace.subx.html144495log stats plain blame
-rw-r--r--057write.subx.html23920log stats plain blame
-rw-r--r--058stream-equal.subx.html86702log stats plain blame
-rw-r--r--059stop.subx.html31868log stats plain blame
-rw-r--r--060read.subx.html63665log stats plain blame
-rw-r--r--061read-byte.subx.html43854log stats plain blame
-rw-r--r--062write-stream.subx.html37884log stats plain blame
-rw-r--r--063error.subx.html9813log stats plain blame
-rw-r--r--064write-byte.subx.html52643log stats plain blame
-rw-r--r--065write-buffered.subx.html33288log stats plain blame
-rw-r--r--066print-int.subx.html53632log stats plain blame
-rw-r--r--067parse-hex.subx.html136127log stats plain blame
-rw-r--r--068error-byte.subx.html16716log stats plain blame
-rw-r--r--069allocate.subx.html36088log stats plain blame
-rw-r--r--070new-stream.subx.html19130log stats plain blame
-rw-r--r--071read-line.subx.html55675log stats plain blame
-rw-r--r--072slice.subx.html174549log stats plain blame
-rw-r--r--073next-token.subx.html291076log stats plain blame
-rw-r--r--074write-stream-data.subx.html18830log stats plain blame
-rw-r--r--075print-int-decimal.subx.html51716log stats plain blame
-rw-r--r--076next-word.subx.html42373log stats plain blame
-rw-r--r--077subx-words.subx.html91498log stats plain blame
-rw-r--r--078emit-hex.subx.html34713log stats plain blame
-rw-r--r--079emit.subx.html68039log stats plain blame
-rw-r--r--080zero-out.subx.html13105log stats plain blame
-rw-r--r--081table.subx.html259040log stats plain blame
-rw-r--r--082slurp.subx.html24304log stats plain blame
-rw-r--r--083subx-widths.subx.html34918log stats plain blame
-rw-r--r--084emit-hex-array.subx.html18018log stats plain blame
-rw-r--r--085next-word-or-string.subx.html69295log stats plain blame
-rw-r--r--090register-names.subx.html3185log stats plain blame
-rw-r--r--091write-int.subx.html18276log stats plain blame
-rw-r--r--092stack.subx.html58434log stats plain blame
-rw-r--r--100array-equal.subx.html54919log stats plain blame
d---------apps1683log stats plain
d---------archive / 2.vm31log stats plain
-rw-r--r--control0.png363435log stats plain blame
-rw-r--r--control1.png377139log stats plain blame
-rw-r--r--encoding.png169620log stats plain blame
-rw-r--r--ex2.mu.png12812log stats plain blame
-rw-r--r--ex3.png185444log stats plain blame
-rw-r--r--mu-init-test.subx.html5179log stats plain blame
-rw-r--r--mu-init.subx.html4287log stats plain blame
-rw-r--r--run_one_test.subx.html6041log stats plain blame
-rw-r--r--trace.png438484log stats plain blame
pan> break-if-= draw-grapheme screen, g, xcurr, y, color, background-color xcurr <- increment loop } set-cursor-position screen, xcurr, y return xcurr } fn draw-text-rightward-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen var result/eax: int <- draw-text-rightward screen, text, x, width, y, color, background-color return result } fn draw-text-rightward-from-cursor screen: (addr screen), text: (addr array byte), xmax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen cursor-x <- draw-text-rightward screen, text, cursor-x, xmax, cursor-y, color, background-color set-cursor-position screen, cursor-x, cursor-y } fn render-grapheme screen: (addr screen), g: grapheme, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { compare g, 0xa/newline var x/eax: int <- copy x { break-if-!= # minimum effort to clear cursor draw-code-point screen, 0x20/space, x, y, color, background-color x <- copy xmin increment y return x, y } draw-grapheme screen, g, x, y, color, background-color x <- increment compare x, xmax { break-if-< x <- copy xmin increment y } return x, y } # draw text in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary # return the next (x, y) coordinate in raster order where drawing stopped # that way the caller can draw more if given the same min and max bounding-box. # if there isn't enough space, truncate fn draw-text-wrapping-right-then-down screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var stream-storage: (stream byte 0x100) var stream/esi: (addr stream byte) <- address stream-storage write stream, text var x/eax: int <- copy _x var y/ecx: int <- copy _y x, y <- draw-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color return x, y } # draw a stream in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary # return the next (x, y) coordinate in raster order where drawing stopped # that way the caller can draw more if given the same min and max bounding-box. # if there isn't enough space, truncate fn draw-stream-wrapping-right-then-down screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var xcurr/eax: int <- copy x var ycurr/ecx: int <- copy y var g/ebx: grapheme <- copy 0 { { var _g/eax: grapheme <- read-grapheme stream g <- copy _g } compare g, 0xffffffff/end-of-file break-if-= xcurr, ycurr <- render-grapheme screen, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color loop } set-cursor-position screen, xcurr, ycurr return xcurr, ycurr } fn draw-stream-wrapping-right-then-down-from-cursor screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen var end-x/edx: int <- copy cursor-x end-x <- increment compare end-x, xmax { break-if-< cursor-x <- copy xmin cursor-y <- increment } cursor-x, cursor-y <- draw-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color } fn draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), stream: (addr stream byte), color: int, background-color: int { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen draw-stream-wrapping-right-then-down-from-cursor screen, stream, 0/xmin, 0/ymin, width, height, color, background-color } fn move-cursor-rightward-and-downward screen: (addr screen), xmin: int, xmax: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen cursor-x <- increment compare cursor-x, xmax { break-if-< cursor-x <- copy xmin cursor-y <- increment } set-cursor-position screen, cursor-x, cursor-y } fn draw-text-wrapping-right-then-down-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var x2/eax: int <- copy 0 var y2/ecx: int <- copy 0 x2, y2 <- screen-size screen # width, height x2, y2 <- draw-text-wrapping-right-then-down screen, text, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color return x2, y2 # cursor-x, cursor-y } fn draw-text-wrapping-right-then-down-from-cursor screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen var end-x/edx: int <- copy cursor-x end-x <- increment compare end-x, xmax { break-if-< cursor-x <- copy xmin cursor-y <- increment } cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color } fn draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen draw-text-wrapping-right-then-down-from-cursor screen, text, 0/xmin, 0/ymin, width, height, color, background-color } fn draw-int32-hex-wrapping-right-then-down screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var stream-storage: (stream byte 0x100) var stream/esi: (addr stream byte) <- address stream-storage write-int32-hex stream, n var xcurr/edx: int <- copy x var ycurr/ecx: int <- copy y { var g/eax: grapheme <- read-grapheme stream compare g, 0xffffffff/end-of-file break-if-= draw-grapheme screen, g, xcurr, ycurr, color, background-color xcurr <- increment compare xcurr, xmax { break-if-< xcurr <- copy xmin ycurr <- increment } loop } set-cursor-position screen, xcurr, ycurr return xcurr, ycurr } fn draw-int32-hex-wrapping-right-then-down-over-full-screen screen: (addr screen), n: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var x2/eax: int <- copy 0 var y2/ecx: int <- copy 0 x2, y2 <- screen-size screen # width, height x2, y2 <- draw-int32-hex-wrapping-right-then-down screen, n, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color return x2, y2 # cursor-x, cursor-y } fn draw-int32-hex-wrapping-right-then-down-from-cursor screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen var end-x/edx: int <- copy cursor-x end-x <- increment compare end-x, xmax { break-if-< cursor-x <- copy xmin cursor-y <- increment } cursor-x, cursor-y <- draw-int32-hex-wrapping-right-then-down screen, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color } fn draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), n: int, color: int, background-color: int { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen draw-int32-hex-wrapping-right-then-down-from-cursor screen, n, 0/xmin, 0/ymin, width, height, color, background-color } fn draw-int32-decimal-wrapping-right-then-down screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var stream-storage: (stream byte 0x100) var stream/esi: (addr stream byte) <- address stream-storage write-int32-decimal stream, n var xcurr/edx: int <- copy x var ycurr/ecx: int <- copy y { var g/eax: grapheme <- read-grapheme stream compare g, 0xffffffff/end-of-file break-if-= draw-grapheme screen, g, xcurr, ycurr, color, background-color xcurr <- increment compare xcurr, xmax { break-if-< xcurr <- copy xmin ycurr <- increment } loop } set-cursor-position screen, xcurr, ycurr return xcurr, ycurr } fn draw-int32-decimal-wrapping-right-then-down-over-full-screen screen: (addr screen), n: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var x2/eax: int <- copy 0 var y2/ecx: int <- copy 0 x2, y2 <- screen-size screen # width, height x2, y2 <- draw-int32-decimal-wrapping-right-then-down screen, n, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color return x2, y2 # cursor-x, cursor-y } fn draw-int32-decimal-wrapping-right-then-down-from-cursor screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen var end-x/edx: int <- copy cursor-x end-x <- increment compare end-x, xmax { break-if-< cursor-x <- copy xmin cursor-y <- increment } cursor-x, cursor-y <- draw-int32-decimal-wrapping-right-then-down screen, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color } fn draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), n: int, color: int, background-color: int { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen draw-int32-decimal-wrapping-right-then-down-from-cursor screen, n, 0/xmin, 0/ymin, width, height, color, background-color } ## Text direction: down then right # draw a single line of text vertically from x, y to ymax # return the next 'y' coordinate # if there isn't enough space, truncate fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int { var stream-storage: (stream byte 0x100) var stream/esi: (addr stream byte) <- address stream-storage write stream, text var ycurr/eax: int <- draw-stream-downward screen, stream, x, y, ymax, color, background-color return ycurr } # draw a single-line stream vertically from x, y to ymax # return the next 'y' coordinate # if there isn't enough space, truncate fn draw-stream-downward screen: (addr screen), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int { var ycurr/ecx: int <- copy y { var g/eax: grapheme <- read-grapheme stream compare g, 0xffffffff/end-of-file break-if-= draw-grapheme screen, g, x, ycurr, color, background-color ycurr <- increment loop } set-cursor-position screen, x, ycurr return ycurr } fn draw-text-downward-from-cursor screen: (addr screen), text: (addr array byte), ymax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen var result/eax: int <- draw-text-downward screen, text, cursor-x, cursor-y, ymax, color, background-color } # draw text down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary # return the next (x, y) coordinate in raster order where drawing stopped # that way the caller can draw more if given the same min and max bounding-box. # if there isn't enough space, truncate fn draw-text-wrapping-down-then-right screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var stream-storage: (stream byte 0x100) var stream/esi: (addr stream byte) <- address stream-storage write stream, text var x/eax: int <- copy _x var y/ecx: int <- copy _y x, y <- draw-stream-wrapping-down-then-right screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color return x, y } # draw a stream down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary # return the next (x, y) coordinate in raster order where drawing stopped # that way the caller can draw more if given the same min and max bounding-box. # if there isn't enough space, truncate fn draw-stream-wrapping-down-then-right screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var xcurr/edx: int <- copy x var ycurr/ecx: int <- copy y { var g/eax: grapheme <- read-grapheme stream compare g, 0xffffffff/end-of-file break-if-= draw-grapheme screen, g, xcurr, ycurr, color, background-color ycurr <- increment compare ycurr, ymax { break-if-< xcurr <- increment ycurr <- copy ymin } loop } set-cursor-position screen, xcurr, ycurr return xcurr, ycurr } fn draw-text-wrapping-down-then-right-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { var x2/eax: int <- copy 0 var y2/ecx: int <- copy 0 x2, y2 <- screen-size screen # width, height x2, y2 <- draw-text-wrapping-down-then-right screen, text, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color return x2, y2 # cursor-x, cursor-y } fn draw-text-wrapping-down-then-right-from-cursor screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen var end-y/edx: int <- copy cursor-y end-y <- increment compare end-y, ymax { break-if-< cursor-x <- increment cursor-y <- copy ymin } cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color } fn draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen draw-text-wrapping-down-then-right-from-cursor screen, text, 0/xmin, 0/ymin, width, height, color, background-color } # hacky error-handling # just go into an infinite loop fn abort e: (addr array byte) { var dummy1/eax: int <- copy 0 var dummy2/ecx: int <- copy 0 dummy1, dummy2 <- draw-text-wrapping-right-then-down-over-full-screen 0/screen, e, 0/x, 0x2f/y, 0xf/fg=white, 0xc/bg=red { loop } }