X86 Assembly Language Programming

Assembly language programming is has many similarities to programming your calculator because your calculator only uses registers and key functions.

Research Links

For this example with the NASM assembler:  opcode destination, source

Base Pointer: EBP:  As the stack grows and shrinks during a function the offset of local variables and function parameters relative to ESP changes. To simplify things Intel uses a base pointer (sometimes called a frame pointer) that is stored in EBP. EBP is a pointer to the top of the stack when the function is first called.

Nasm Assembly Programming 

U-Boot Commands

base    – print or set address offset
bootm   – boot application image from memory
bootp   – boot image via network using BootP/TFTP protocol
cmp     – memory compare
cp      – memory copy
crc32   – checksum calculation
dhcp    – invoke DHCP client to obtain IP/boot params
dump_hw_info – dump hardware info
erase   – erase FLASH memory
exit    – exit script
flinfo  – print FLASH memory information
format_flash_fs – format flash file system
format_uboot_env – format uboot environment.
go      – start application at address 'addr'
help    – print online help
image_flash     – upgrade image via network using TFTP protocol
image_netboot   – boot image via network using TFTP protocol
loads   – load S-Record file over serial line
md      – memory display
mm      – memory modify (auto-incrementing)
mtest   – ALT RAM test
mw      – memory write (fill)
nm      – memory modify (constant address)
ping    – send ICMP ECHO_REQUEST to network host
print_bootinfo  – print boot info of device
print_bootparam – print boot parameters of device
printenv- print environment variables
protect – enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset – Perform RESET of the CPU
reset_dummy – Perform RESET of the CPU
run     – run commands in an environment variable
saveenv – save environment variables to persistent storage
set_bootparam   – set boot parameters of device
setenv  – set environment variables
test    – minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
version – print monitor version

USB Port on Routers

I have an access point with a USB port on it. It also has a console and ethernet port.   What is the USB port used for?  At first I thought it might be the port used for serial but rechecking using google that is the console port.  It turns out the more modern routers can connect with other peripherals such as external hard disk and printer and even to a 3G dongle.

I think there might be exceptions such as with the Alfa AP121U access point.  When you flash it with Pinneaple router you use the USB port.

Inaccessible WordPress Subdirectories with .htaccess Password Protection

When using WordPress with candied URLs you are using .htaccess files to do URL rewrites to make the more human and google friendly URL version. It turns out that when you try to access a subdirectory that is password protected it returns the web server responds with a “401 Unauthorized” header and an optional error document, then prompts the user for Authentication details. When rewrite rules are in place, the default error document path used by the web server is evaluated using the rewrite rules. If an actual error document does not exist in the default error document path, this is passed on to the CMS for parsing. In this case, since the file is not found, the CMS gets confused and displays a 404 error rather than a 401, causing the web server to not even prompt for authentication.

The fix is to add the following line to your .htaccess file:

     ErrorDocument 401 default

When the code is matched it just does nothing to the URL and exits. 

Research Links