Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[MASM32] A wsprintf prototype replacement

Featured Replies

Posted

Hello guys...

The wsprintf function is very cool, but it destroy most of registers.

The most important in this function is the conversion, and the only needed return value is the size of formatted buffer.

I have written the following prototype to include some functions of wsprintf, and the only modified value in return was eax, which contains the size of buffer.

Also included is a test program.

Currently supports:

- %s (string)

- %??d (decimal signed, up to 16 chars displayed)

- %??X (haxadecimal, up to 16 chars displayed)

- %??u (decimal, up to 16 chars displayed).

The working method is like the original wsprintf function...

Any comments / ideas / tests are welcome...

Laurent aka BIGBOSS from COPs.

A little comparative

* parameters: CTEXT("%s"), CTEXT("PARAMETERS").

- wsprintf : 257 cycles. (result: PARAMETERS).

- _cpswsprintf : 71 cycles. (result: PARAMETERS). => faster

* parameters: CTEXT("%d"), -27194193.

- wsprintf : 1365 cycles. (result: -27194193).

- _cpswsprintf : 564 cycles. (result: -27194193). => faster

* parameters: CTEXT("%u"), 123456789.

- wsprintf : 1494 cycles. (result: 123456789).

- _cpswsprintf : 641 cycles. (result: 123456789). => faster

* parameters: CTEXT("%08X"), 123456789.

- wsprintf : 1222 cycles. (result: 075BCD15).

- _cpswsprintf : 299 cycles. (result: 075BCD15). => faster

testprogram.zip

Edited by bigboss-62

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.