Skip to navigation

Lander on the Acorn Archimedes

Drawing lines: DrawLineSegment

Name: DrawLineSegment [Show more] Type: Subroutine Category: Drawing lines Summary: Draw a horizontal line of between 0 and 17 pixels by jumping to the relevant entry point Deep dive: Drawing triangles
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * lineJump calls DrawLineSegment

Arguments: R8 Line colour (in the form of a four-pixel colour word) R11 Screen address of left end of line
.DrawLineSegment STRB R8, [R11, #16] \ Draw a horizontal line of 17 pixels STRB R8, [R11, #15] \ Draw a horizontal line of 16 pixels STRB R8, [R11, #14] \ Draw a horizontal line of 15 pixels STRB R8, [R11, #13] \ Draw a horizontal line of 14 pixels STRB R8, [R11, #12] \ Draw a horizontal line of 13 pixels STRB R8, [R11, #11] \ Draw a horizontal line of 12 pixels STRB R8, [R11, #10] \ Draw a horizontal line of 11 pixels STRB R8, [R11, #9] \ Draw a horizontal line of 10 pixels STRB R8, [R11, #8] \ Draw a horizontal line of 9 pixels STRB R8, [R11, #7] \ Draw a horizontal line of 8 pixels STRB R8, [R11, #6] \ Draw a horizontal line of 7 pixels STRB R8, [R11, #5] \ Draw a horizontal line of 6 pixels STRB R8, [R11, #4] \ Draw a horizontal line of 5 pixels STRB R8, [R11, #3] \ Draw a horizontal line of 4 pixels STRB R8, [R11, #2] \ Draw a horizontal line of 3 pixels STRB R8, [R11, #1] \ Draw a horizontal line of 2 pixels STRB R8, [R11] \ Draw a horizontal line of 1 pixel MOV PC, R14 \ Return from the subroutine