Hide menu

TDDI11 Embedded software

Vt2 2024


Latest News...


250415  IN/OUT instructions in chapter 3 (polling and interrupts)
 

The IN/OUT instructions cannot take a port number that does not fit in 8-bits. The port number used in the lab is 0x3F8 and does not fit in 8 bits. You need to go through dx as explained in the compendium. Also, you need to read/write one byte a time and therefore need to use "al" as the destination/source. Using "ax" or "eax" would result in different opcodes, hence reading/writing more than one byte. See "Input from Port" in page 3-520 of this manual.


250415  Passing arguments in chapter 3 (polling and interrupts)
 

Do note that "void SerialPut(char ch)" takes one argument while "void SerialISR(void)" does not (see serial.h). You can find the argument to SerialPut as you did in chap2 for llmultiply. In addition, "BOOL QueueInsert(QUEUE* q, void *data)" (see libepc.h under /courses/TDDI11/sw/include) takes two pointers as arguments. One of them can be the value of the "data" label. The label "data" can be treated as the address of the byte defined at line 3 in "serial.asm". The other argument should be a pointer to the queue defined in "main.c". The "inbound_queue" label defined as external in "serial.asm" should be treated as the address of the "inbound_queue" variable defined in "main.c" (which happens to be a pointer to a QUEUE created in line 18 of "main.c"). In other words: data is the address of the byte where you should store the byte you get in the ISR and [inbound_queue] is the address of the queue from main.c (i.e. inbound_queue in serial.asm is the address of the inbound_queue pointer in main.c which contains the address of the QUEUE). You want to pass data and [inbound_queue] as a parameter to QueueInsert.


250415  About chapter 2 (mixing c and assember)
 

Check the documentation of libepc.h here to find how to count the number cycles, or the time in milliseconds, when you compare the C (optimized/non-optimized) and assembly versions of your llmultiply method.


240312  The course web pages are being updated for 2024.


Page responsible: Ahmed Rezine
Last updated: 2022-03-23