Page 1 of 1

11:07 !!!. LTE O < Back Practical 8 Submission In the next few questions you will gradually be writing ARM assembly code

Posted: Fri Apr 29, 2022 8:35 am
by answerhappygod
11 07 Lte O Back Practical 8 Submission In The Next Few Questions You Will Gradually Be Writing Arm Assembly Code 1
11 07 Lte O Back Practical 8 Submission In The Next Few Questions You Will Gradually Be Writing Arm Assembly Code 1 (95.94 KiB) Viewed 24 times
the question is long because its written in two
different language.
i will give like if the solution is even 80 percent
correct..
11:07 !!!. LTE O < Back Practical 8 Submission In the next few questions you will gradually be writing ARM assembly code that will display the following diamond image on a memory mapped display. The display Imagine that the microcontroller on which our ARM assembly code will run now has a screen attached to it (in reality we will only use the emulator and a simulated screen). This screen can display 16x16 pixel images and is "memory mapped" to the memory addresses Ox2000 to Ox20FF. Each pixel colour is stored as a single unsigned 8-bit number. Since this means that only 256 different
11:07 !!!. LTE O < Back Practical 8 Submission The display Imagine that the microcontroller on which our ARM assembly code will run now has a screen attached to it (in reality we will only use the emulator and a simulated screen). This screen can display 16x16 pixel images and is "memory mapped" to the memory addresses 0x2000 to Ox20FF. Each pixel colour is stored as a single unsigned 8-bit number. Since this means that only 256 different colours are possible the VGA colour palette is used as a look-up-table to determine the final colour to draw. This palette with associated memory values is shown below. Note that the row and column values are given in hexadecimal. Therefore, the value of Ox2F represents green. $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A SOB $OC $OD $0E $OF $00 $10 $20 $30 $40 $50 $60 $70 $80 $90 $AO $BO $C0 $DO
11:07 !!!. LTE O < Back Practical 8 Submission TUILLIUM alicu UI DAIL) may ve ustu to cause the screen to update: UPDATE MOV R10, #1 MOV R10, #0 MOV PC, LR To download, setup and use the display, please follow the following steps: . Download the "VisUAL Memory Mapped Display.exe" from SunLearn. (Note that it currently only runs on Windows). Copy it to the root folder of where you VisUAL emulator is extracted. (in other words, place this new .exe file in the exact same folder as where your VisUAL.exe file is located) Run the "VisUAL Memory Mapped Display.exe" - if at this stage Windows complains that the file might be unsafe, just ignore this message and run it anyway. Click on "Load", and select the .s file that you created in VisUAL that you wish to run. You should see your code appear in the text box next to the button - verify that it is the correct version of your code. Click on "RUN" to start executing the program. Note that if your code renders an animation, then you can adjust the frame rate at the bottom.
11:08 !!!! LTE O < Back Practical 8 Submission Question 3 Not yet answered Marked out of 2.00 Draw a single pixel -- Teken 'n enkele pixel Write a function that can draw a single pixel to the screen. You function must be called "DRAW_PIXEL" and should receive three parameters, x, y and colour, (in this order) indicating the position of the pixel on the screen as well as which 8-bit colour value should be written to that pixel. The function does not return anything. Note that the origin is at the top-left and that the the y-axis runs from top to bottom. Both x and y are values between 0 and 15. In the image below you can see how you can calculate the memory offset from the base address (0x2000) to get to the exact byte that you are interested in. For example the orange(64) pixel is located at address Ox2064, the blue(A9) one at Ox20A9 and the green(EB) one at Ox20EB. Skryf 'n funksie wat 'n enkele pixel na die skerm to skryf. Die funksie se naam moet "DRAW_PIXEL" wees en dit moet drie parameters aanvaar: x, y, en kleur, in hierdie volgorde. Die parameters dui die posisie van die pixel op die skerm aan sowel as die 8-bit kleur waarde wat na die pixel geskryf moet
11:08 !!!! LTE O < Back Practical 8 Submission INCU Por you word. Die funksie het geen terugkeer waarde nie. Let wel dat die oorsprong by die linker- boontste hoek is en dat die y-as van bo na onder loop. Beide x en y is waardes tussen 0 en 15. In die figuur hieronder kan gesien word hoe die geheue offset met verwysing tot die basis- addres (Ox2000) bereken kan word om die byte van belang te vind. Byvoorbeeld die oranje(64) pixel is by addres Ox2064, die blou(A9) een by Ox20A9, en die groen (EB) een by Ox20EB. х Column Index (Hex) 00 01 02 03 04 05 06 07 08 09 OA OB OC OD OE OF 00 10 20 30 40 50 у 60 64 Row Index (Hex) 70 80 90 AO A9 BO 00 DO ЕВ EO FO TIP: A possible formula that may be used to calculate the offset based on values of x and y is (and consider using logical shifts): offset
11:08 !!!! LTE O < Back Practical 8 Submission Question 4 Not yet answered Marked out of 2.00 Clear the screen Herstel die skerm Write a function that can clear the entire screen with a specific colour. Your function must be called "CLEAR_SCREEN" and should receive a single parameter, colour, indicating the colour with which the screen must be cleared. Therefore, by the end of this function, all the pixels of the screen must be set to the specified colour value. ONLY SUBMIT THE CODE FOR THE FUNCTION ITSELF (and no additional code) Skryf 'n funksie wat die hele skerm na 'n spesifieke kleur verander. Die funksie moet "CLEAR_SCREEN" genoem word, en moet 'n enkele parameter, kleur, ontvang. Die parameter is die kleur waarna die hele skerm verander moet word. Wanneer hierdie funksie klaar uitgevoer het, moet al die pixels van die skerm die spesifieke kleur wees. SUBMIT SLEGS DIE KODE VIR DIE FUNKSIE (en geen addisionele kode nie).
11:09 ::. LTE O < Back Practical 8 Submission Question 5 Not yet answered Marked out of 2.00 Drawing a diagonal line -- Teken 'n diagonale lyn Now write an entire program (and submit all your code) that uses your DRAW_PIXEL and CLEAR_SCREEN functions that you wrote in the previous questions. Start by clearing the screen with white (Hex value: 0x0F). Then draw a diagonal line from the top left to the bottom right using the blue colour with Hex value: 0x09. You may decide to update after drawing each pixel (thereby seeing an animation in the screen tool), or after all the pixels were written. Skryf nou 'n volledige program (en submit al die kode daarvan) wat die DRAW_PIXEL en CLEAR_SCREEN funksies gebruik wat u in die vorige vrae geskryf het. Begin deur die hele skerm na wit (Hex value: OXOF) te herstel. Teken dan 'n diagonale lyn van bo links na onder regs deur blou (Hex Value: 0x09) te gebruik. U kan besluit of die program na elke pixel update (en sodoende 'n stap vir stap animasie in die skerm-tool te sien), of nadat al die pixels na die skerm geskryf is.
11:10 :!! LTE I < Back Practical 8 Submission pixel (thereby seeing an animation in the screen tool), or after all the pixels were written. Skryf nou 'n volledige program (en submit al die kode daarvan) wat die DRAW_PIXEL en CLEAR_SCREEN funksies gebruik wat u in die vorige vrae geskryf het. Begin deur die hele skerm na wit (Hex value: OXOF) te herstel. Teken dan 'n diagonale lyn van bo links na onder regs deur blou (Hex Value: 0x09) te gebruik. U kan besluit of die program na elke pixel update (en sodoende 'n stap vir stap animasie in die skerm-tool te sien), of nadat al die pixels na die skerm geskryf is.
11:10 !!!. LTE O < Back Practical 8 Submission Question 6 Not yet answered Marked out of 2.00 Draw a cross -- Teken 'n kruis Repeat the previous question but now draw a cross instead of only a single diagonal line. The background must still use Hex code OxOF and the cross must use Hex code Ox09. Submit your entire program. Herhaal die vorige vraag, maar teken nou 'n kruis in plaas van 'n enkele diagonale lyn. Die agtergrond moet steeds Hex-waarde OxOF gebruik, en die kruis Hex-waarde Ox09. Submit u hele program. =
11:11 !!!. LTE O < Back Practical 8 Submission INOL Yel answereu Question 7 Marked out of 3.00 Draw the outline of the diamond -- Teken die buitelyn van die diamant Follow the same process as in the previous two questions, but now draw the diamond outline as is shown below. The background must still use Hex code OxOF and the outline must use Hex code Ox09. Submit your entire program. Volg dieselfde proses as in die vorige twee vrae, maar teken nou die diamant soos hieronder getoon. Die agtergrond moet steeds Hex-waarde OxOF gebruik, en die buitelyn Hex-waarde Ox09. Submit u hele program.
11:11 - LTE 1 < Back Practical 8 Submission Question 8 Not yet answered Marked out of 2.00 Draw a filled diamond -- Teken 'n ingekleurde diamant Expand on your code for the previous question to draw a filled diamond as shown below. Use Hex value 0x4F for the inside. Submit your entire program. Brei u program van die vorige vraag uit om 'n ingekleurde diamant te teken soos hieronder getoon. Gebruik Hex-waarde Ox4F vir die binnekant. Submit u hele program.