Write a program that inputs two integers (paper color and ink color) and draws an oval on Mars «Bitmap Display» with following settings (note 4X4 pixel size:

To draw an oval you should scale a circle to fit screen rectangle. Look at the example code. After drawing an oval, the program prints all videomemory out in hexadecimal.

3377169
16763989

0x00338811
0x00338811
0x00338811
...
0x00ffcc55
0x00ffcc55
0x00ffcc55
...
0x00338811
0x00338811
0x00338811

Example code:

   1 .eqv    WIDTH   128
   2 .eqv    HEIGHT  64
   3 # Variables
   4 .data   0x10008000
   5 X0:     .float  -1
   6 X1:     .float  1
   7 Y0:     .float  -1
   8 Y1:     .float  1
   9 W:      .float  127
  10 H:      .float  63
  11 ZERO:   .float  0
  12 ONE:    .float  1
  13 # program fragment
  14 .text
  15         # ... (come code)
  16         l.s     $f12 ONE
  17         li      $s0 0
  18 lines:  li      $s1 0
  19 dots:   iscale  ZERO H Y0 Y1 $s0 $f8
  20         iscale  ZERO W X0 X1 $s1 $f10
  21         mul.s   $f8 $f8 $f8
  22         mul.s   $f10 $f10 $f10
  23         add.s   $f8 $f8 $f10
  24         c.lt.s  $f8 $f12
  25         movt    $s4 $s2
  26         movf    $s4 $s3
  27         dot     $s1 $s0 $s4
  28         loop    $s1 WIDTH dots
  29         loop    $s0 HEIGHT lines
  30         # ... (some other code)

In this example:

Hint: the settings are equivalent to this (note 1x1 pixel size): egg1.png

Here is full output for checking: output.txt


CategoryHomework

HSE/ArchitectureASM/Homework_NotOval (последним исправлял пользователь FrBrGeorge 2019-12-15 22:03:22)