How many predominant function calling conventions (cdecl and stdcall) are commonly utilized when interfacing high-level programming languages with assembly routines?
Ch 16: Interfacing Assembly with C/C++
Practical guide to mixed-language programming, writing assembly subroutines callable from C, passing pointer arguments, accessing struct members in assembly, and inline assembly syntax.
69 Questions69 MCQs0 Short Questions0 Long Questions
SEMESTER PASS
CS401 - Computer Architecture and Assembly Language Programming Examination Practice
Timed practice exam simulation for CS401 - Computer Architecture and Assembly Language Programming.
Showing 21 โ 30 of 69 Questions
Page 3 of 7
In NASM assembly syntax, an imported symbol defined in another module is declared using the ________ directive, while an exported symbol made visible to other modules is declared using the ________ directive.
In NASM assembly syntax, an imported symbol defined in an external module is declared using the ________ directive, while an exported symbol made visible to other modules is declared using the ________ directive.
In the stdcall / Pascal function calling convention, clearing parameters off the stack frame after subroutine execution is performed by the ________.
Given the following 32-bit x86 NASM assembly subroutine 'swap' that exchanges two integer values via pointer arguments on the stack, write a complete C main program that prototype-declares and invokes this assembly function.
```assembly
[section .text]
global swap
swap:
mov ecx, [esp+4] ; Copy pointer p1 into ECX
mov edx, [esp+8] ; Copy pointer p2 into EDX
mov eax, [ecx] ; Load *p1 into EAX
xchg eax, [edx] ; Exchange EAX with *p2
mov [ecx], eax ; Write updated value back to *p1
ret ; Return to C caller
```
Write a complete C main program that links with and invokes the 32-bit x86 NASM assembly subroutine 'swap' to exchange two integer variables, and specify the command used to assemble the NASM source file.
In Motorola 68K processors, what is the 32-bit register that holds the address of the currently executing instruction?
In Motorola 68K processors, what is the bit-width of the Program Counter (PC) register that holds the address of the currently executing instruction?
In Motorola 68K processors, what is the bit-width of the general-purpose registers?
How many general-purpose registers (data registers and address registers combined) are available in Motorola 68K processors?