assembly


Using hex numbers in MSP430 assembler


I'm new to assembly (we are using it at school with an MSP430 controller) and I'm trying to do two things.
moving an hex number to a certain location: mov #FFFh, R5 (moving it into the fifth register)
comparing an hex number with another: cmp #FFFh, #45
mov.b #0, R4 ; indice
mov.b #0, R5 ; contatore
bis.b #00000001b, P1DIR ; led rosso
bis.b #10000000b, P4DIR ; led verde
main_loop: cmp #19, R5
jz end
cmp #FFFFh, 2C00h(R4)
jnz nope
jmp yep
nope: inc.b R4
jmp main_loop
yep: inc.b R4
inc.b R5
jmp main_loop
end: cmp #5, R5
jge red_led
jmp green_led
red_led: bis.b #00000001b, P1OUT
green_led: bis.b #10000000b, P4OUT
The compiler log (we are using CCS, CodeComposer) says:
"../main.asm", ERROR! at EOF: [E0300] The following symbols are undefined:
FFFFh
How can I fix this?
A word starting with a digit (0 … 9) is interpreted as a number.
A word starting with a letter (A … Z) is interpreted as a name (of a register or a variable or a label).
So when a hexadecimal number starts with a letter, you must add a zero:
cmp #0FFFFh, 2C00h(R4)

Related Links

Exactly how “fast” are modern CPUs?
How can I tell if a number is a multiple of four using only the logic operator AND?
What is the best resource for learning (N)ASM?
Assembly: Invalid effective address
lower level assembly language? (how are processor instructions implemented?)
What is the function of the “mov eax, cr3; mov cr3, eax” in x86 assembly code?
How are mutex and lock structures implemented?
Disable Hardware & Software Interrupts
Why is memory area $1020 unwriteable on M68HC12 with staa?
How to perform low-level IO with a USB flash drive under the BIOS (compared to a floppy)?
How do you allocate an array so it starts at certain place in memory?
about assembly CF(Carry) and OF(Overflow) flag
accessing assembly condition code
What is the “EU” in x86 architecture? (calculates effective address?)
Do I have to pop the error code pushed to stack by certain exceptions before returning from the interrupt handler?
What should I know when switching from MIPS to x86 assembly?

Categories

HOME
turing-machines
delphi-7
gdb
time-complexity
jmeter
wakanda
object
datastore
hessian
javacc
mips
onclick
lanczos
performancepoint
dkim
ibeacon-android
emoji
spring-social
supervisor
nancy
code-generation
shared-libraries
dynatrace
cumulocity
bitnami
linear-algebra
entitymanager
forgot-password
sencha-touch
undertow
babel
href
dapper-extensions
fable-f#
linked-data
fossil
yowsup
python-pptx
docfx
skylink
android-softkeyboard
drupal-theming
signal-strength
facebook-social-plugins
phpdbg
vaadin-elements
servermanager
jboss-4.2.x
gitlist
identification
skin
janus
lsyncd
gameplay-kit
sandcastle
polyline
vcloud-director-rest-api
gets
hadoop-2.7.2
qtplugin
signalr.client
dup
google-query-language
mediametadataretriever
nss
gcloud-ruby
cda
thread-sleep
django-urls
dock
atoi
cocos3d
with-statement
ignite-ui
android-framework
beaker-testing
nevron
composite-component
wp7test
xcode3.2
inkcanvas
koken
entity-attribute-value
jquery-tools
promotion-code
lr
instantiationexception
zend-rest
sifr
product-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App