Sorry, but I need a little more clarity. "I can easily trap the register contents, watch them all day within the debugger." Denigrating the customer doesn't really help a whole lot. we reply "which make and model" OK< I want to examine (not in the Disassembly listing) what is in the registers by printing the contents of the registers out. Jim, assembly code ? Similar to high level languages, ARM supports operations on different datatypes. (from I assume you are using the ARM Compiler 5, (ARMCC) not ARM LR). ). Where do you think you would put it? I'd like to experiment in uVision, but not sure, should I have to compiler 6. The values left in the registers when the function returns may or may not be useful. Now I understand! This way a 64-bit number n represented using two 32-bit parts, n lower and n higher will have the value n = 2 32 × n higher + n lower We will, obviously, need to kep the 32-bit somewhere. I think you are very confused! or should he just keep quiet? ARM and Thumb instructions can only be 32 bits wide. Hi guys, I was wondering how I can print to the console the contents of the Stack? You might also make use of the fact that the four banks of registers are also the first 32 bytes of internal RAM. Print the relativized value of each specified register regname. inline assembly and embedded assembly. "Why is it that the "experts" on this forum always fire back some smart-assed "why do you want to do that?" putting __asm in front of the function name lets you modify the See: In embedded assembly, you can specify registers to be used: when you single step through the debugger, you can view the 256 Program to find the no. It was not the processor doing that for you - it was your Software tools; ie, some software running on your development system. My brain can only hold so much, you know. But as you can see that code, that is a In-line assembly. If you 'phone your doctor and ask "How do I remove one of my kidneys", what would you expect his answer to be? Why is it that the "experts" on this forum always fire back some smart-assed "why do you want to do that?" This is part two of the ARM Assembly Basics tutorial series, covering data types and registers. Or disassemble You are NOT using the actual registers on the In that example they used gcc to link it. "...the old Rational machine, which would even correct your Ada syntax..." It sounds as though you haven't ever actually printed out the internal register's contents from the evasions and offensive remarks on this board. Did you expect to find a "pront register opcode"? • Store return value in stack frame of caller! How to print register value in assembly language Here is the AT&T assembler function I came up with in order to print something during the Linux kernel debugging. How do you call out the specific registers, e.g. function send return value back to caller function?! You need to describe what you are doing as well as what you want (print out the register contents) Each personal computer has a microprocessor that manages the computer's arithmetical, logical, and control activities. We have already used the system calls. ARM's branch and link instruction, BL, automatically saves the return address in the register R14 (i.e. registers directly. So what's the problem, then?? We will use the same program and tools as in Run a minimalistic program written in assembler on STM32-H103 development board. As someone who's been on the fired-at end of their remarks sometimes, I think I understand. Each family of processors has its own set of instructions for handling various operations such as getting input from keyboard, displaying information on screen and performing vario… Buy Quality PP,Drivers license,ID cards,etc, ST-link doesnt run the MCU after programming and reset in KEIL 5.33. printf will blindly print the garbage contents of that parameter register. Get the compiler to produce an assembly listing. Got it? When keeping them in registers, we will use two consecutive registers (e.g. Assuming the lower FOUR bits of CX (CL) are use as a value we want to print a HEX of, according to ascii table: If so - risking being pedantic, there is a difference between If any of the above offend you, remove the offence by being clear what you are doing: C or assembler - never stated reason for register dump - never stated why the simulator can not help - never stated. "with some kind of special character" "Why is it that the "experts" on this forum always fire back some smart-assed "why do you want to do that?" we reply "cant help you" http://www.keil.com/support/man/docs/uv4/uv4_db_dbg_cpuregs.htm, http://www.keil.com/support/man/docs/uv4/uv4_db_dbg_disasmwin.htm. "...as a systems analyst..." I hope this is clearer. Won't do it again. Can't find anything about this in the Help either. you say "registers" and "printf()". below. For instance, in this case, what they're trying to avoid is answering Alice's question about how to print out the register contents only to deal the very next day with something like "Why don't the registers have the data I expect?". I have studied the MCS-51 Instruction set (8051 instruction set summary) but I do not see how to print out the registers' contents. I'm not using Keil's PRINTF, by the way, but my own. Here I explain ARM assembly program to add numbers declared in an array. the module after compilation. R1? Bank0 or bankn? ALGORITHM: Start Create an array of numbers Initialize a counter register to the number of elements in an array Load base address of an array to a register… reply" And no, I don't expect this micro=controller to be as user-friendly as the old Rational machine, which would even correct your Ada syntax as you typed it in. In this post, we'll learn how to print strings and integers to the console on Linux using Intel Assembly. Registers, as such, are totally uninteresting in "C" programming, except in the case where printf() would not help you any. "I want to print those contents out from the calling program" regname may be any register name valid on the machine you are using`$'. Print the relativized value of each specified register regname. "I would think this tool could help" If you can set up a project that does serial I/O, printing the registers is just a matter of passing those values to your print routine. How can i access their values? "Printing" is a fairly complex operation. It is also common that the "solution" itself is flawed - and is the source the questioner's difficulties. Erik. To print out the value of the AX register in hex for example: mov ax, 0x1234 call printw int 0x20 printw: push ax shr ax, 8 call printb pop ax push ax and ax, 0xff call printb pop ax ret printb: push ax shr al, 4 call printasc pop ax and al, 0xf call printasc ret printasc: add al, 0x30 cmp al, 0x39 jle printasc_e add al, 0x7 printasc_e: mov dl, al mov ah, 0x2 int 0x21 ret You say "my car makes a pinging noise" Program to print Upper Case Letters from A to Z ( Simulation of Do-While Loop ) Program to print all the ASCII characters i.e.