This is my assembly code. It draws a pink square 32x32 from position 0. My goal is to make a checkboard pattern. Can you finish the code so it does that. This is a 16bit simulator of assembly. Only four registers for arithematics. draw1: MOV A, 2 ; Set the bitmap mode . OUT 7 MOV A, 3 ; Clear the video memory . OUT 7 MOV C, 0 NOT D MUL 32 MOV B, D draw2: MOV A, B OUT 8 MOV A, 238 OUT 9 ADD B, 1 ; paints ADD C, 1 ;increments counter CMP C, 32 JZ row CMP C, 64 JZ row CMP C, 96 JZ row CMP C, 128 JZ row CMP C, 160 JZ row CMP C, 192 JZ row CMP C, 224 JZ row CMP C, 256 JZ row CMP C, 288 JZ row CMP C, 320 JZ row CMP C, 352 JZ row CMP C, 384 JZ row CMP C, 416 JZ row CMP C, 448 JZ row CMP C, 480 JZ row CMP C, 512 JZ row CMP C, 544 JZ row CMP C, 576 JZ row CMP C, 608 JZ row CMP C, 640 JZ row CMP C, 672 JZ row CMP C, 704 JZ row CMP C, 736 JZ row CMP C, 768 JZ row CMP C, 800 JZ row CMP C, 832 JZ row CMP C, 864 JZ row CMP C, 896 JZ row CMP C, 928 JZ row CMP C, 960 JZ row CMP C, 992 JZ row CMP C, 1024 JZ row JMP draw2 row: ADD B, 256 SUB B, 32 CMP C, 1024 JZ exit JMP draw2: exit: HLT Note: Try to follow the syntax like i did so that i can compile it when i get the result.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This is my assembly code. It draws a pink square 32x32 from position 0. My goal is to make a checkboard pattern. Can you finish the code so it does that. This is a 16bit simulator of assembly. Only four registers for arithematics.

draw1:
MOV A, 2 ; Set the bitmap mode .
OUT 7
MOV A, 3 ; Clear the video memory .
OUT 7
MOV C, 0
NOT D
MUL 32
MOV B, D
draw2:
MOV A, B
OUT 8
MOV A, 238
OUT 9
ADD B, 1 ; paints
ADD C, 1 ;increments counter
CMP C, 32
JZ row
CMP C, 64
JZ row
CMP C, 96
JZ row
CMP C, 128
JZ row
CMP C, 160
JZ row
CMP C, 192
JZ row
CMP C, 224
JZ row
CMP C, 256
JZ row
CMP C, 288
JZ row
CMP C, 320
JZ row
CMP C, 352
JZ row
CMP C, 384
JZ row
CMP C, 416
JZ row
CMP C, 448
JZ row
CMP C, 480
JZ row
CMP C, 512
JZ row
CMP C, 544
JZ row
CMP C, 576
JZ row
CMP C, 608
JZ row
CMP C, 640
JZ row
CMP C, 672
JZ row
CMP C, 704
JZ row
CMP C, 736
JZ row
CMP C, 768
JZ row
CMP C, 800
JZ row
CMP C, 832
JZ row
CMP C, 864
JZ row
CMP C, 896
JZ row
CMP C, 928
JZ row
CMP C, 960
JZ row
CMP C, 992
JZ row
CMP C, 1024
JZ row
JMP draw2
row:
ADD B, 256
SUB B, 32
CMP C, 1024
JZ exit
JMP draw2:
exit:
HLT

Note: Try to follow the syntax like i did so that i can compile it when i get the result.

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Fundamentals of Computer System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education